package com.fs.sys.entityservice.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fs.sys.bean.dto.AnnouncementDTO;
import com.fs.sys.bean.query.AnnouncementQuery;
import com.fs.sys.domain.entity.AnnouncementEntity;
import com.fs.sys.domain.mapper.AnnouncementMapper;
import com.fs.sys.entityservice.AnnouncementEntityService;
import com.fs.common.base.service.AbstractBaseEntityService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * 系统公告服务实现 
 * @author Coder Generator 2025-06-06 11:02:59 
 **/
@Service
public class AnnouncementEntityServiceImpl extends AbstractBaseEntityService<AnnouncementEntity, AnnouncementDTO, AnnouncementMapper, AnnouncementQuery> implements AnnouncementEntityService {
    @Override
    protected QueryWrapper<AnnouncementEntity> queryToWrapper(AnnouncementQuery query) {
        return this.createQueryWrapper()
                .eq(StringUtils.isNotBlank(query.getId()), "id", query.getId())
                .in(null != query.getIds(), "id", query.getIds())
                .orderByDesc("create_time");
    }
}